{% set htdocs = payload[0] %}
{% set htsdict = payload[1] %}
{% if htdocs.length %}
  <div class="section page--homework_main">
    <div class="section__header">
      <h1 class="section__title">{{ _('Homework') }}</h1>
    </div>
    <ol class="section__list homework__list">
      {%- for tdoc in htdocs -%}
        <li class="section__list__item homework__item">
          <div class="media">
            <div class="media__left medium">
              <div class="homework__date numbox">
                <div class="numbox__num large">{{ datetimeSpan(tdoc['penaltySince'], false, 'D')|safe }}</div>
                <div class="numbox__text">{{ datetimeSpan(tdoc['penaltySince'], false, 'YYYY-M')|safe }}</div>
              </div>
            </div>
            <div class="media__body medium">
              <h1 class="homework__title"><a href="{{ url('homework_detail', tid=tdoc.docId) }}" data-emoji-enabled>{{ tdoc['title'] }}</a></h1>
              <ul class="supplementary list">
                <li>{{ _('Status') }}: {{ _(model.contest.statusText(tdoc)) }}</li>
                <li>{{ _('Open Since') }}: {{ datetimeSpan(tdoc['beginAt'])|safe }}</li>
                <li>
                  {% if model.contest.isExtended(tdoc) or model.contest.isDone(tdoc) %}
                    {{ _('Hard Deadline') }}: {{ datetimeSpan(tdoc['endAt'])|safe }}
                  {% else %}
                    {{ _('Deadline') }}: {{ datetimeSpan(tdoc['penaltySince'])|safe }}
                  {% endif %}
                </li>
                {% if htsdict[tdoc['docId']]['attend'] == 1 %}
                  <li class="homework__info-attended">
                    <span class="icon icon-check"></span> {{ _('Claimed') }}
                  </li>
                {% endif %}
              </ul>
            </div>
          </div>
        </li>
      {%- endfor -%}
    </ol>
    <ul class="pager pager-bottom"><li>
      <a class="pager__item next link" href="{{ url('homework_main') }}">{{ _('More') }} ></a>
    </li></ul>
  </div>
{% endif %}